import Button from '@mui/material/Button';
import Dialog from '@mui/material/Dialog';
import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import DialogContentText from '@mui/material/DialogContentText';
import DialogTitle from '@mui/material/DialogTitle';
import useMediaQuery from '@mui/material/useMediaQuery';
import { useTheme } from '@mui/material/styles';

export default function ConfirmDialog({message,open, onYes,onNo}) {
  const theme = useTheme();
  const fullScreen = useMediaQuery(theme.breakpoints.down('md'));
  
  return (   
      <Dialog
        fullScreen={fullScreen}
        open={open}
        onClose={onNo}
        aria-labelledby="{message.message}">
        <DialogTitle id="{message.message}">
          {"Confirm"}
        </DialogTitle>
        <DialogContent>
          <DialogContentText>
           {message}
          </DialogContentText>
        </DialogContent>
        <DialogActions>
          <Button autoFocus onClick={onNo}>
            No
          </Button>
          <Button onClick={onYes} autoFocus>
            Yes
          </Button>
        </DialogActions>         
      </Dialog>   
  );
}